package jspservlet.dao.impl;

//import java.sql.PreparedStatement;
import jspservlet.dao.FamilyDAO;
import jspservlet.vo.Family;
import jspservlet.vo.Connection;
import org.json.*;


public class FamilyDAOImpl implements FamilyDAO{
	
	public int registfamily(Family family) throws Exception{
		Connection conn=new Connection();

		JSONObject TEST=new JSONObject();

		TEST.put("route","registerfamily");
		JSONObject test=new JSONObject();
		test.put("familyID", family.getFamilyID());
		test.put("fName", family.getfName());
		test.put("address", family.getAddress());
		test.put("shanchu", family.getShanchu());
		TEST.put("data",test);

		JSONObject returnMsg=conn.transport(TEST);

		int success=returnMsg.getInt("success");
		if (success==1) 
			System.out.println("注册成功"); 
		else 
			System.out.println("注册失败");
		return success;

}
}
